class LibraryBooks:
    book_num = 100
    rend_book_num = 0

    @classmethod
    def get_book_num(cls):
        print('-' * 10)
        print(f'总书籍数量：{cls.book_num}')
        print(f'已借出书籍数量：{cls.rend_book_num}')
        print(f'可借书籍数量：{cls.book_num - cls.rend_book_num}')
        print('-' * 10)

    @classmethod
    def add_book(cls, n):
        cls.book_num += n
        print(f'新上{n}本书')

    @classmethod
    def del_book(cls, n):
        if n > cls.book_num:
            print(f'图书馆不干,仓库清空')
            cls.book_num = 0
        else:
            cls.book_num -= n
            print(f'发大水冲走了{n}本书')

    def __init__(self):
        self.library_name = '<伟大张睿的私人图书馆>'

    def rent_book(self, n):
        fine_books = LibraryBooks.book_num - LibraryBooks.rend_book_num
        if fine_books >= n:
            LibraryBooks.rend_book_num += n
            print(f'你从{self.library_name}借走了{n}本书')
        else:
            print(f'{self.library_name}里没这么多书了，你只从{self.library_name}借走{fine_books}本书')
            LibraryBooks.rend_book_num = LibraryBooks.book_num

    def return_book(self, n):
        if n <= LibraryBooks.rend_book_num:
            LibraryBooks.rend_book_num -= n
            print(f'你还给{self.library_name}{n}本书')
        else:
            print(f'还多了,多的不要.你还给{self.library_name}{LibraryBooks.rend_book_num}本书')
            LibraryBooks.rend_book_num = 0


if __name__ == '__main__':
    library = LibraryBooks()
    library.rent_book(2)
    library.get_book_num()
    library.return_book(3)
    library.add_book(80)
    library.get_book_num()
    library.del_book(200)

